package mediadisplay.ui.spacecontrols 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	/**
	 * ...
	 * @author Anders Figenschow selvfølgelig
	 */
	public class MovementButton extends Sprite
	{
		private var _txt:String;
		
		public static const LEFT:String = "left";
		public static const RIGHT:String = "right";
		public static const UP:String = "up";
		public static const DOWN:String = "down";
		public static const FORWARD:String = "forward";
		public static const BACK:String = "back";
		
		public function MovementButton(txt:String) 
		{
			_txt = name = txt;
			
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
			
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			var tf:TextField = new TextField();
			addChild(tf);
			tf.border = true;
			tf.borderColor = 0xff0000;
			tf.autoSize = TextFieldAutoSize.LEFT;
			tf.text = _txt;
			tf.background = true;
			tf.backgroundColor = 0xffffff;
			tf.textColor = 0x000000;
			tf.selectable = false;
			tf.mouseEnabled = false;
			
			buttonMode = true;
			
		}
		
	}

}